// import {createWorker} from "tesseract.js"

async function ocrTesseract(clicked) {
  console.log("recognizing...");
  const worker = await Tesseract.createWorker("eng");
  await worker.setParameters({
    // tessedit_char_whitelist: "1234567890-. "
    tessedit_char_whitelist: "1234567890-. +abcdefgxyzmn",
  });
  const ret = await worker.recognize("./pic.png");
  // console.log(ret.data.text)
  let txt = ret.data.text;
  txt = txt.replaceAll("-", " -");
  let div = clicked.parentNode;
  div.getElementsByTagName("textarea")[0].value = txt;
  div.getElementsByTagName("img")[0].classList.remove("displayNone");
  await worker.terminate();
}
